package com.yunji.hushuang.observer;

import com.google.common.eventbus.Subscribe;

import java.text.SimpleDateFormat;

/**
 * @author hushuang
 * @since 2019/10/31
 */
public class Moments {

    private String owner;

    public Moments(String owner) {
        this.owner = owner;
    }

    @Subscribe
    public void update(Message message) {
        System.out.println("==========" + owner + "的朋友圈==========\n");
        String date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(message.getDate());
        System.out.println(String.format("“%s”发布了内容：\n%s\n%s\n", message.getPublisher(), message.getContent(), date));
    }
}
